﻿<Window x:Class="CPPEI.BD.VMTool.VMToolWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="视频矩阵切换" Height="auto" Width="auto" x:Name="Window" WindowState="Normal" WindowStartupLocation="CenterScreen" ResizeMode="CanResize" >

    <Window.Resources>
        <SolidColorBrush x:Key="CheckBoxStroke" Color="#8E8F8F"/>
        <Style x:Key="CheckRadioFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Margin="14,0,0,0" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="RadioButtonStyle" TargetType="{x:Type RadioButton}">
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="Background" Value="#F4F4F4"/>
            <Setter Property="BorderBrush" Value="{StaticResource CheckBoxStroke}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RadioButton}">
                        <BulletDecorator x:Name="bulletDecorator" Background="Transparent">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualState x:Name="Checked">
                                        <Storyboard>
                                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="bulletDecorator">
                                                <EasingColorKeyFrame KeyTime="0" Value="#FF0073FF"/>
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unchecked">
                                        <Storyboard>
                                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="bulletDecorator">
                                                <EasingColorKeyFrame KeyTime="0" Value="#FFF4F4F4"/>
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Indeterminate"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>

                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </BulletDecorator>
                        <ControlTemplate.Triggers>
                            <Trigger Property="HasContent" Value="true">
                                <Setter Property="FocusVisualStyle" Value="{StaticResource CheckRadioFocusVisual}"/>
                                <Setter Property="Padding" Value="4,0,0,0"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="Button" x:Key="gdFunc">
            <Setter Property="Height" Value="59" />
            <Setter Property="Width" Value="320" />
            <Setter Property="Background">
                <Setter.Value>
                    <ImageBrush ImageSource="Images/save1.png" />
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="Button" x:Key="gdSelectFunc">
            <Setter Property="Height" Value="59" />
            <Setter Property="Width" Value="311" />

            <Setter Property="DockPanel.Dock" Value="Left" />
            <Setter Property="Background">
                <Setter.Value>
                    <ImageBrush ImageSource="Images/save-down.png" />
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="Grid" x:Key="selectSolutionButton">
            <Setter Property="Background">
                <Setter.Value>
                    <ImageBrush ImageSource="Images/faqie.png" />
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="Grid" x:Key="solutionButton">
            <Setter Property="Background">
                <Setter.Value>
                    <ImageBrush ImageSource="Images/fa.png" />
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="MenuItem" x:Key="menuItem">
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="Height" Value="40"/>
            <Setter Property="Width" Value="210"/>
            <Setter Property="Background">
                <Setter.Value>
                    <ImageBrush ImageSource="Images/topbon50px.png" />
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="MenuItem" x:Key="selectMenuItem">
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="Height" Value="40"/>
            <Setter Property="Width" Value="210"/>
            <Setter Property="Background">
                <Setter.Value>
                    <ImageBrush ImageSource="Images/leftbton.jpg" Stretch="Fill" />
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="tabItem" TargetType="Grid">
            <Setter Property="Background">
                <Setter.Value>
                    <ImageBrush ImageSource="Images/tab-on.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="selectTabItem" TargetType="Grid">
            <Setter Property="Background">
                <Setter.Value>
                    <ImageBrush ImageSource="Images/tab-releve.png"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="selectSort" TargetType="Grid">
            <Setter Property="Background">
                <Setter.Value>
                    <ImageBrush ImageSource="Images/selectSort.jpg"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="sort" TargetType="Grid">
            <Setter Property="Background" Value="Transparent">

            </Setter>
        </Style>

    </Window.Resources>
  
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="77"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="20"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid  Grid.Row="0">
            <Grid.ColumnDefinitions >
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <StackPanel x:Name="_stackPanel" Grid.Column="0" >
                <StackPanel.Background>
                    <ImageBrush ImageSource="Images/top1.jpg"/>
                </StackPanel.Background>
                <Button x:Name="spFunction" Tag="func" Style="{StaticResource gdFunc}" Click="spFunction_Click_1" >
                    <TextBlock Text="设置并保存当前配置" VerticalAlignment="Center" HorizontalAlignment="Center"  FontFamily="微软雅黑" FontWeight="Bold" FontSize="18" Margin="5" />
                </Button>
            </StackPanel>
            <Button Grid.Column="1"  Content="关闭" Width="80" Click="Button_Click"/>
        </Grid>
        <WrapPanel x:Name="_ctlWrapMatrixs" Grid.Row="1" HorizontalAlignment="Stretch">
            <WrapPanel.Background>
                <ImageBrush ImageSource="Images/top2bg.jpg"/>
            </WrapPanel.Background>
            <Canvas   Width="192" Height="171" Margin="5">
                <Rectangle Width="192" Height="171" >
                    <Rectangle.Fill>
                        <ImageBrush ImageSource="Images/top2mk.png"/>
                    </Rectangle.Fill>

                </Rectangle>
                <Label   Content="Signal 1" VerticalAlignment="Bottom" HorizontalAlignment="Center"   />
            </Canvas>
            <Popup x:Name="_ctlPopupMatrix" Closed="_ctlPopupVideo_Closed" PopupAnimation="Fade" Width="88" Height="auto" PlacementTarget="{Binding ElementName=btn_xiangji}" Placement="Top" AllowsTransparency="True" StaysOpen="False" IsOpen="False">
                <StackPanel x:Name="_ctlSelectedStackPanleMatrixs">

                </StackPanel>
            </Popup>
            <Popup x:Name="_ctlPopupSolution" Closed="_ctlPopupMatrix_Closed_1"  PopupAnimation="Fade" Width="88" Height="auto" PlacementTarget="{Binding ElementName=btn_xiangji}" Placement="Top" AllowsTransparency="True" StaysOpen="False" IsOpen="False">
                <StackPanel x:Name="_ctlSelectedStackPanleSolution">
                    <Button x:Name="_ctlBtnDeleteSolution" Content="删除" Click="_ctlBtnDeleteSolution_Click_1" Height="44"/>
                </StackPanel>
            </Popup>
        </WrapPanel>
        <StackPanel Grid.Row="2">
            <StackPanel.Background>
                <ImageBrush ImageSource="Images/top3.jpg"/>
            </StackPanel.Background>
        </StackPanel>
        <Grid Grid.Row="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock  FontSize="15"  Height="44" Grid.Column="0">
                <TextBlock.Background>
                    <ImageBrush ImageSource="Images/topbt1.jpg"/>
                </TextBlock.Background>
                    <Label  Content="类别"  FontWeight="SemiBold" FontSize="22" Height="44" Width="210" Foreground="Black"   HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
            </TextBlock>
            <Grid Height="44" Grid.Column="1">
                <Grid.Background>
                    <ImageBrush ImageSource="Images/right-topbg.jpg"/>
                </Grid.Background>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.1*"/>
                    <ColumnDefinition Width="0.1*"/>
                    <ColumnDefinition Width="0.1*"/>
                    <ColumnDefinition Width="0.1*"/>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="0.1*"/>
                    <ColumnDefinition Width="0.1*"/>
                </Grid.ColumnDefinitions>
                <Label x:Name="_ctlTxtBlockState" Grid.Column="0"  FontWeight="Bold" Foreground="White" Content="全部" Height="33" VerticalContentAlignment="Center" FontSize="18" HorizontalContentAlignment="Center"/>
                <Label x:Name="_ctlTxtBlockOrder" Grid.Column="1" Content="排序:" Height="33" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="18"  Foreground="White" />
                <Grid x:Name="_ctlBtnNumber" Grid.Column="2" MouseLeftButtonDown="_ctlBtnNumber_MouseLeftButtonDown_1">
                    <Label x:Name="_ctlLblNumber" Foreground="White" Content="按序号↑" Height="33" VerticalAlignment="Center"  FontSize="18"   HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
                </Grid>
                <Grid x:Name="_ctlBtnFrequency"  Grid.Column="3" MouseLeftButtonDown="_ctlBtnFrequency_MouseLeftButtonDown_1">
                    <Label  Foreground="White" x:Name="_ctlLblFrequency" Content="按使用频率↑" Height="33" VerticalAlignment="Center"  FontSize="18"   HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
                </Grid>
                <RadioButton Grid.Column="5" GroupName="tab" IsChecked="True" Click="RadioButton_Click_1"  Width="135" FontFamily="微软雅黑"  FontSize="15" Height="33"  Content="所有方案" Style="{StaticResource RadioButtonStyle}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
                <RadioButton Grid.Column="6" GroupName="tab" Click="RadioButton_Click_2" Width="135" FontFamily="微软雅黑"  FontSize="15" Height="33"  Content="所有信号"  Style="{StaticResource RadioButtonStyle}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
            </Grid>
        </Grid>

        <Grid Grid.Row="4" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto" MinWidth="210"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <ScrollViewer  Grid.Column="0" VerticalScrollBarVisibility="Auto" Height="auto">
                <StackPanel  ScrollViewer.VerticalScrollBarVisibility="Auto">
                    <StackPanel.Background>
                        <ImageBrush ImageSource="Images/leftbg.png"/>
                    </StackPanel.Background>
                    <StackPanel x:Name="_ctlStackPanelSorts" Height="auto" ScrollViewer.VerticalScrollBarVisibility="Auto">

                    </StackPanel>
                </StackPanel>
            </ScrollViewer>
            <Grid x:Name="_ctlTabVidesSoltions"  Margin="0,0,0,0" Height="auto"  Grid.Column="1">
                <Popup x:Name="_ctlPopupVideo" PopupAnimation="Fade" Width="88" Height="auto" PlacementTarget="{Binding ElementName=btn_xiangji}" Placement="Top" AllowsTransparency="True" StaysOpen="False" IsOpen="False">
                    <StackPanel x:Name="_ctlStackPanleMatrixs">

                    </StackPanel>
                </Popup>
                <ScrollViewer x:Name="_ctlScrollViewerVideos" Visibility="Collapsed" VerticalScrollBarVisibility="Auto">
                    <WrapPanel x:Name="_ctlWrapPanelVideo" MinHeight="300" Height="auto" ScrollViewer.VerticalScrollBarVisibility="Auto">


                    </WrapPanel>

                </ScrollViewer>

                <ScrollViewer x:Name="_ctlScrollViewerSolutions"  VerticalScrollBarVisibility="Auto">
                    <WrapPanel x:Name="_ctlWplSolutions" MinHeight="300" Height="auto"  ScrollViewer.VerticalScrollBarVisibility="Auto"/>
                </ScrollViewer>

            </Grid>

        </Grid>

    </Grid>
</Window>
